/* 
 * File:   netcdfRead.hpp
 * Author: gian
 *
 * Created on July 19, 2012, 2:26 PM
 */

#ifndef NETCDFREAD_HPP
#define	NETCDFREAD_HPP

#include <netcdfcpp.h>
#include "vector.hpp"

class netcdf_is_complex_float {
public:
    netcdf_is_complex_float(const char* filename, const char* channelname);
    virtual ~netcdf_is_complex_float();
    void read(cvectorf* data);
    void read(vectorf* redata, vectorf* imdata);
    void read(cvectorf* data, vector* times);
    void read(vectorf* redata, vectorf* imdata, vector* times);
    void read(cvector* data);
    void read(vector* redata, vector* imdata);
    void read(cvector* data, vector* times);
    void read(vector* redata, vector* imdata, vector* times);    
private:
    void OpenFile();
    void GetRecord();
    NcFile *mFile;
    std::string mFilename;
    std::string mChannelname;
    std::string mChannelnameRe;
    std::string mChannelnameIm;
    int mCheckpointCount;
    NcVar *mRealVar;
    NcVar *mImaginaryVar;
    NcVar *mTimeVar;
    int mRecords;
    int mRecordSize;
    long mRecordRead;
    float *mRealData;
    float *mImaginaryData;
    int mDataRead;
    double mStartTime;
    double mDt;
};



#endif	/* NETCDFREAD_HPP */

